-
Notifications
You must be signed in to change notification settings - Fork 223
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update to new MOI nonlinear interface #1052
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1052 +/- ##
==========================================
- Coverage 84.94% 84.62% -0.32%
==========================================
Files 44 44
Lines 3427 3422 -5
==========================================
- Hits 2911 2896 -15
- Misses 516 526 +10
|
lgtm |
Should be ready from my side as well |
@pkofod bump |
I'll review it, thanks |
Okay, fairly small change compared to the original. LGTM |
This PR did not appropriately update the compat in Project.toml: #1060 |
@blegat, is there a way this can support both the old and the new interface? |
It's not too hard, what's the motivation ? |
Legacy code may not yet be updated to the new NLP interface. Now that I think of it, I think it would be ok if there was one version that worked with the old NLP interface and another version that only supported the new one. When I tried to use the old NLP interface with the current tagged release of Optim it did not seem to work for me. |
Yes, the addition of the old NLP was merged a few months ago so after the latest release. I thought that since it's a new feature there is no need to maintain support for the old interface |
Ya I agree no need to maintain support for the old interface, but can we make sure there is a release where the old interface works? |
The issue is that v1 has already been tagged so if we release a version with the old interface and then remove it, it's a breaking change and we need v2 |
Good point. I was very confused when I made my first comment on this. I thought that in a previously release this package had been working with the legacy NL interface, but that is not the case. I 100% agree going for the new NL interface, folks should be targeting that for new code development. |
JuMP v1.15 now supports providing the nonlinear objective and constraints with
@objective
and@constraint
.The old syntax
@NLobjective
and@NLconstraint
is kept for backward compatibility only.Since the MOI wrapper in Optim is new, we don't need to support the old interface so this PR replace it the new one which works with
@objective
and@constraint
.